/**
 *  @author Ion Morozan
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.dddforandroid.database.server;

import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Convenience definitions for NotePadProvider
 * 
 * @version 2009-01-12, 23:09 UTC
 */
public final class NotePad {
	public static final String AUTHORITY = "com.dddforandroid.database.NotePadProvider";

	// This class cannot be instantiated
	private NotePad() {}

	/**
	 * Notes table
	 */
	public static final class Notes implements BaseColumns {
		private String id;
		private String title;
		private String note;
		private Long createdDate;

		public void setCreatedDate(Long createdDate) {
			this.createdDate = createdDate;
		}

		public String getId() {
			return id;
		}

		public void setId(String id) {
			this.id = id;
		}

		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		public String getNote() {
			return note;
		}

		public void setNote(String note) {
			this.note = note;
		}

		public Long getCreatedDate() {
			return createdDate;
		}

		public Notes() {}

		/**
		 * The content:// style URL for this table
		 */
		public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/notes");

		/**
		 * The MIME type of {@link #CONTENT_URI} providing a directory of notes.
		 */
		public static final String CONTENT_TYPE = "vnd.android.cursor.dir/notes";

		/**
		 * The MIME type of a {@link #CONTENT_URI} sub-directory of a single note.
		 */
		public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/notes";

		/**
		 * The title of the note
		 * <P>Type: TEXT</P>
		 */
		public static final String TITLE = "title";

		/**
		 * The note itself
		 * <P>Type: TEXT</P>
		 */
		public static final String NOTE = "note";

		/**
		 * The timestamp for when the note was created
		 * <P>Type: INTEGER (long from System.curentTimeMillis())</P>
		 */
		public static final String CREATED_DATE = "created";

		/**
		 * The timestamp for when the note was last modified
		 * <P>Type: INTEGER (long from System.curentTimeMillis())</P>
		 */
		public static final String MODIFIED_DATE = "modified";

		/**
		 * Tags associated with a note.
		 * Multiple tags are separated by commas.
		 * <P>Type: TEXT</P>
		 * @since 1.1.0
		 */
		public static final String TAGS = "tags";

		/**
		 * Whether the note is encrypted.
		 * 0 = not encrypted. 1 = encrypted.
		 * <P>Type: INTEGER</P>
		 * @since 1.1.0
		 */
		public static final String ENCRYPTED = "encrypted";

		/**
		 * A theme URI.
		 * <P>Type: TEXT</P>
		 * @since 1.1.0
		 */
		public static final String THEME = "theme";
		
		/**
		 * The starting position of the selection in the note.
		 * <p>TYPE: INTEGER</p>
		 * @since 1.2.3
		 */
		public static final String SELECTION_START = "selection_start";
		
		/**
		 * The ending position of the selection in the note.
		 * <p>TYPE: INTEGER</p>
		 * @since 1.2.3
		 */
		public static final String SELECTION_END = "selection_end";
		
		/**
		 * The scroll position in the list expressed as scrollY/height
		 * TODO Implement.
		 * <p>TYPE: REAL</p>
		 * @since 1.2.3
		 */
		public static final String SCROLL_POSITION = "scroll_position";

		/**
		 * Support sort orders. The "sort order" in the preferences
		 * is an index into this array.
		 */
		public static final String[] SORT_ORDERS = {"title ASC", "title DESC", "modified DESC", "modified ASC", "created DESC", "created ASC"};
	}
}
